package com.chuyu.jzwboa.fragment.offmoblie;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.chuyu.jzwboa.R;
import com.chuyu.jzwboa.activity.offciemobile.OffDocDisposeActivity;
import com.chuyu.jzwboa.adapter.offmoblie.OffDocFragAdapter;
import com.chuyu.jzwboa.base.MVPBaseFragment;
import com.chuyu.jzwboa.presenter.offmobile.SendDocFragPresnter;
import com.chuyu.jzwboa.view.iview.offmobile.ISendDocFragView;
import com.jcodecraeer.xrecyclerview.XRecyclerView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * @author 杨仕俊
 * @description 发文
 * Created by wo on 2017/12/16.
 */

public class SendDocFragment extends MVPBaseFragment<ISendDocFragView, SendDocFragPresnter>
        implements ISendDocFragView {
    @BindView(R.id.off_doc_xrv)
    XRecyclerView offDocXrv;
    private OffDocFragAdapter adapter;

    @Override
    protected void initView() {
        List<String> list = new ArrayList<>();
        for (int i = 0; i < 6; i++) {
            list.add("");
        }
        OffDocFragAdapter.OnItemClickListeners onItemClickListeners = new OffDocFragAdapter.OnItemClickListeners() {
            @Override
            public void onItemclick(View view, int position) {
                Intent intent = new Intent(getActivity(), OffDocDisposeActivity.class);
                startActivity(intent);
            }
        };
        adapter = new OffDocFragAdapter(getActivity(), list, onItemClickListeners);
        //设置方向
        LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        offDocXrv.setLayoutManager(layoutManager);

    }

    @Override
    protected void initData() {
         offDocXrv.setAdapter(adapter);
    }

    @Override
    protected int initContentLayout() {
        return R.layout.fragment_off_doc;
    }

    @Override
    public SendDocFragPresnter createPresenter() {
        return new SendDocFragPresnter();
    }


}
